﻿/*
using MyGeneration/Template/NHibernate (c) by lujan99@usa.net
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace DokuzEylul.Sinav.Entities
{
	/// <summary>
	/// SinavUserRole object for NHibernate mapped table 'SinavUserRole'.
	/// </summary>
	[Serializable]
    public class SinavUserRole : Unipa.Framework.Data.BaseDbEntity
	{
		#region Member Variables
		protected int m_userrole;
		protected string m_rolecode;
		protected Guid m_userid;
		protected int? m_menuid;
		#endregion
		#region Constructors
			
		public SinavUserRole() {}
					
		public SinavUserRole(string rolecode, Guid userid, int? menuid) 
		{
			this.m_rolecode= rolecode;
			this.m_userid= userid;
			this.m_menuid= menuid;
		}

		#endregion
		#region Public Properties
		public  virtual int UserRole
		{
			get { return m_userrole; }
			set {m_userrole= value; }
		}
		public  virtual string RoleCode
		{
			get { return m_rolecode; }
			set {m_rolecode= value; }
		}
		public  virtual Guid Userid
		{
			get { return m_userid; }
			set {m_userid= value; }
		}
		public  virtual int? MenuId
		{
			get { return m_menuid; }
			set {m_menuid= value; }
		}
		#endregion
		
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			if( ( obj == null ) || ( obj.GetType() != this.GetType() ) ) return false;
			SinavUserRole castObj = (SinavUserRole)obj;
			return ( castObj != null ) &&
			this.m_userrole == castObj.UserRole;
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
			int hash = 57;
			hash = 27 * hash * m_userrole.GetHashCode();
			return hash;
		}
		#endregion
		
	}
}
